//#include<bits/stdc++.h>
//using namespace std;
//long long w(long long a,long long b,long long c)
//{
//	if(a<=0||b<=0||c<=0) return 1;
//	else if(a>20||b>20||c>20) return w(20,20,20);
//	else if(a<b&&b<c) return w(a,b,c-1)+w(a,b-1,c-1)-w(a-1,b-1,c-1);
//	else return w(a-1,b,c)+w(a-1,b-1,c)+w(a-1,b,c-1)-w(a-1,b-1,c-1);
//}
//int main()
//{
//	long long a,b,c;
//	while(cin>>a>>b>>c&&a!=-1||b!=-1||c!=-1)
//	{
//		printf("w(%lld, %lld, %lld) = %lld",a,b,c,w(a,b,c));
//	}
//    return 0;
//}



#include <iostream>
#include <cstdio>
using namespace std;
typedef long long LL;
LL W[21][21][21];
 
LL w(LL a, LL b, LL c) {
    if (a <= 0 || b <= 0 || c <= 0)
	a = b = c = 0;
    if (a > 20 || b > 20 || c > 20)
	a = b = c = 20;
    if (W[a][b][c])	   
	return W[a][b][c];
    if (a <= 0 || b <= 0 || c <= 0)  
	return W[0][0][0] = 1;
    if (a > 20 || b > 20 || c > 20)  
	return W[20][20][20] = w(20, 20, 20);
    if (a < b && b < c)
	return W[a][b][c] = w(a, b, c - 1) + w(a - 1, b, c - 1) - w(a - 1, b - 1, c - 1);
    return W[a][b][c] = w(a - 1, b, c) + w(a - 1, b - 1, c) + w(a - 1, b, c - 1) - w(a - 1, b - 1, c - 1);
}
 
int main() {
    LL a, b, c;
    while (cin >> a >> b >> c) 
	{
        if (a == -1 && b == -1 && c == -1)
		break;
        printf("w(%lld, %lld, %lld) = %lld\n", a, b, c, w(a, b, c));
    }
    return 0;
}
